home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickDraw3D 1.6 SDK / Mac SampleCode New for 1.6 / CullGroupSample / Source / Main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  2.1 KB  |  121 lines  |  [TEXT/CWIE]

  1. /****************************/
  2. /*         CULL TEST            */
  3. /* By Brian Greenstone      */
  4. /****************************/
  5.  
  6.  
  7. /****************************/
  8. /*    EXTERNALS             */
  9. /****************************/
  10. #include <Fonts.h>
  11. #include <Resources.h>
  12.  
  13. #include <Rave.h>
  14.  
  15. #include "myglobals.h"
  16. #include "qd3d_support.h"
  17. #include "objects.h"
  18. #include "mymenus.h"
  19. #include "mywindows.h"
  20. #include "myevents.h"
  21. #include "main.h"
  22. #include "misc.h"
  23. #include "3dmf.h"
  24. #include "process.h"
  25.  
  26. extern    QD3DSetupOutputType        gModelViewInfo;
  27.  
  28. /****************************/
  29. /*    PROTOTYPES            */
  30. /****************************/
  31.  
  32. static    void ToolBoxInit(void);
  33.  
  34.  
  35. /****************************/
  36. /*    CONSTANTS             */
  37. /****************************/
  38.  
  39.  
  40. /****************************/
  41. /*    VARIABLES             */
  42. /****************************/
  43.  
  44.  
  45. short        gMainAppRezFile;
  46.  
  47.  
  48.  
  49. /*****************/
  50. /* TOOLBOX INIT  */
  51. /*****************/
  52.  
  53. static void ToolBoxInit(void)
  54. {
  55. TQ3Status    myStatus;
  56.  
  57.      MaxApplZone();
  58.     InitGraf(&qd.thePort);
  59.     FlushEvents ( everyEvent, REMOVE_ALL_EVENTS);
  60.     InitFonts();
  61.     InitWindows();
  62.     InitDialogs(NIL_POINTER);
  63.     InitCursor();
  64.     InitMenus();
  65.     TEInit();
  66.     
  67.     gMainAppRezFile = CurResFile();
  68.     
  69.     
  70.             /* SEE IF QD3D AVAILABLE */
  71.     
  72.     if((void *)Q3Initialize == (void *)kUnresolvedCFragSymbolAddress)
  73.         DoFatalAlert("\pQuickDraw 3D version 1.5 or better is required to run this application!");
  74.  
  75.     myStatus = Q3Initialize();
  76.     if ( myStatus == kQ3Failure )
  77.         DoFatalAlert("\pQ3Initialize returned failure.");                
  78. }
  79.  
  80.  
  81.  
  82. /*****************/
  83. /* TOOLBOX EXIT  */
  84. /*****************/
  85.  
  86. static void ToolBoxExit(void)
  87. {
  88. TQ3Status    myStatus;
  89.  
  90.     myStatus = Q3Exit();
  91.     if ( myStatus == kQ3Failure )
  92.         DoFatalAlert("\pQ3Exit returned failure.");                
  93. }
  94.  
  95.  
  96. /************************************************************/
  97. /******************** PROGRAM MAIN ENTRY  *******************/
  98. /************************************************************/
  99.  
  100.  
  101. void main(void)
  102. {
  103.     ToolBoxInit();
  104.     InitMenuBar();
  105.  
  106.                 /* INIT STUFF */
  107.  
  108.     InitObjectManager();
  109.     InitTest();                                // create QD3D window environment    
  110.  
  111.                 /* PROGRAM MAIN LOOP */
  112.  
  113.     while (true)
  114.         HandleEvents();
  115.  
  116.     ToolBoxExit();
  117. }
  118.  
  119.  
  120.  
  121.